<?php
class adminModel extends baseModel{
    protected $table = 'admin';
    //登陆
    public function getUserInfo($username){
        $user_array = $this->find(array('username'=>$username));
    	if($user_array){
    	    if($username == $user_array['username']){
    		  return $user_array;
            }
    	}else{
    	    return false;
    	}
    }
    //更新登陆信息
    public function upUserInfo($id){
		$data = array();
		$data['login_ip'] = get_client_ip();
		$data['login_time'] = time();
		$this->update(array('id'=>$id),$data);
		return TRUE;
    }
}